home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Apple II Sample Code / MPW IIGS SC / SC.004.Custom.Control / BoxCtrl.aii next >
Encoding:
Text File  |  1990-06-24  |  17.9 KB  |  721 lines  |  [TEXT/MPS ]

  1. *******************************************************************************
  2. *
  3. * Custom Control -- Version 3.0
  4. *
  5. * (C)  Copyright Apple Computer, Inc. 1988-1990
  6. * All rights reserved.
  7. *
  8. * Developer Technical Support Apple II Sample Code
  9. *
  10. * by Keith Rollin
  11. *
  12. * The Custom control is a rectangle with little knobs on the corners and
  13. * sides. The knobs can be dragged to change the size of the rectangle.
  14. * Clicking on the frame will allow you to move the whole thing.
  15. *
  16. * The application sample shows how to create and use the control. It is used
  17. * to size and position a Simple Button control.
  18. *
  19. *******************************************************************************
  20. **********************************************************************
  21. *     This program and its derivatives are licensed only for         *
  22. *     use on Apple computers.                                        *
  23. *                                                                    *
  24. *     Works based on this program must contain and                   *
  25. *     conspicuously display this notice.                             *
  26. *                                                                    *
  27. *     This software is provided for your evaluation and to           *
  28. *     assist you in developing software for the Apple IIGS           *
  29. *     computer.                                                      *
  30. *                                                                    *
  31. *     DISCLAIMER OF WARRANTY                                         *
  32. *                                                                    *
  33. *     THE SOFTWARE IS PROVIDED "AS IS" WITHOUT                       *
  34. *     WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,               *
  35. *     WITH RESPECT TO ITS MERCHANTABILITY OR ITS FITNESS             *
  36. *     FOR ANY PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO             *
  37. *     THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH            *
  38. *     YOU.  SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU (AND            *
  39. *     NOT APPLE OR AN APPLE AUTHORIZED REPRESENTATIVE)               *
  40. *     ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING,             *
  41. *     REPAIR OR CORRECTION.                                          *
  42. *                                                                    *
  43. *     Apple does not warrant that the functions                      *
  44. *     contained in the Software will meet your requirements          *
  45. *     or that the operation of the Software will be                  *
  46. *     uninterrupted or error free or that defects in the             *
  47. *     Software will be corrected.                                    *
  48. *                                                                    *
  49. *     SOME STATES DO NOT ALLOW THE EXCLUSION                         *
  50. *     OF IMPLIED WARRANTIES, SO THE ABOVE EXCLUSION MAY              *
  51. *     NOT APPLY TO YOU.  THIS WARRANTY GIVES YOU SPECIFIC            *
  52. *     LEGAL RIGHTS AND YOU MAY ALSO HAVE OTHER RIGHTS                *
  53. *     WHICH VARY FROM STATE TO STATE.                                *
  54. *                                                                    *
  55. *                                                                    *
  56. **********************************************************************
  57.     eject
  58.     PRINT NOGEN,NOHDR
  59.  
  60.     case   on
  61.  
  62.     STRING ASIS
  63.  
  64.     PRINT PUSH,OFF
  65.     INCLUDE 'M16.Util'
  66.     INCLUDE 'M16.ProDOS'
  67.     INCLUDE 'M16.MiscTool'
  68.     INCLUDE 'M16.QUICKDRAW'
  69.     INCLUDE 'E16.Quickdraw'
  70.     INCLUDE 'M16.MEMORY'
  71.     INCLUDE 'E16.Memory'
  72.     INCLUDE 'M16.EVENT'
  73.     INCLUDE 'E16.EVENT'
  74.     INCLUDE 'M16.LOCATOR'
  75.     INCLUDE 'M16.Menu'
  76.     INCLUDE 'M16.Control'
  77.     INCLUDE 'E16.Control'
  78.     INCLUDE 'M16.Window'
  79.     INCLUDE 'E16.Window'
  80.     INCLUDE 'M16.Dialog'
  81.     INCLUDE 'E16.Dialog'
  82.     INCLUDE 'M16.LineEdit'
  83.     INCLUDE 'M16.IntMath'
  84.     INCLUDE 'M16.Scrap'
  85.     INCLUDE 'M16.Desk'
  86.     INCLUDE 'M16.Texttool'
  87.     PRINT POP
  88.  
  89. *******************************************************************************
  90. *
  91. *    Equates used in this program.
  92. *
  93. *******************************************************************************
  94. DPHandle    equ 0    ; Handle to Tool Direct Page area
  95. DPPointer    equ DPHandle+4    ; Pointer to Tool Direct Page area
  96. deref    equ DPPointer+4    ; Temporary Handle dereference area
  97. Ctl1Ptr    equ deref+4
  98. Ctl2Ptr    equ Ctl1Ptr+4
  99. Control1    equ Ctl2Ptr+4
  100. Control2    equ Control1+4
  101.  
  102. ScreenMode    equ mode640    ; used for _QDStartup
  103. ScreenWidth    equ 640    ; used for _EMStartup
  104.  
  105.  
  106.     EJECT
  107. *******************************************************************************
  108. *
  109. Main    PROC
  110. *
  111. * Description:    This is the main routine. It calls routines to Initialize
  112. *    the tools, initialize application specific data, run the
  113. *    main EventLoop, close the application, and close the tools.
  114. *    Then it calls the ProDOS Quit command.
  115. *
  116. *
  117. * Inputs:    NONE
  118. *
  119. * Outputs:    NONE
  120. *
  121. * External Refs:
  122.     import InitTools
  123.     import InitApp
  124.     import EventLoop
  125.     import CloseApp
  126.     import CloseTools
  127.     import QuitParms
  128. *
  129. * Entry Points:    NONE
  130. *
  131. *******************************************************************************
  132.  
  133.     jsr InitTools
  134.     jsr InitApp
  135.  
  136.     _ShowCursor
  137.  
  138.     jsr EventLoop
  139.  
  140.     jsr CloseApp
  141.     jsr CloseTools
  142.  
  143.     _Quit QuitParms
  144.  
  145.     ENDP
  146.  
  147.     EJECT
  148. *******************************************************************************
  149. *
  150. Globals    Record
  151. *
  152. * Description:    Holder of all of our data.
  153. *
  154. *
  155. * Inputs:    N/A
  156. *
  157. * Outputs:    N/A
  158. *
  159. * External Refs:    
  160.     import doUpdate    ; to update windows
  161. *
  162. * Entry Points:
  163.     export QuitParms    ; used by Main
  164. *
  165. *******************************************************************************
  166. *
  167. * Standard global data
  168. *
  169. *******************************************************************************
  170.  
  171. TitleString    str 'Custom Control Example Program'
  172. AutString    str 'By Keith Rollin Apple DTS -- Version 3.0'
  173. VersString    str 'Copyright (c) 1988-1990 Apple Computer'
  174.  
  175. MenuHeight    ds.b 2    ; Stored height of menu bar
  176. MyID    ds.b 2    ; Application ID
  177. MyDP    ds.b 2    ; My direct page storage
  178.  
  179. QuitFlag    ds.W 1
  180. QuitParms    dc.l 0    ; Pathname of next app
  181.     dc.w $00    ; flags
  182.  
  183. EventRecord
  184. EventWhat    ds.b 2
  185. EventMessage    ds.b 4
  186. EventWhen    ds.b 4
  187. EventWhere    ds.b 4
  188. EventModifiers    ds.b 2
  189. TaskData    ds.b 4
  190. TaskMask    dc.l $0000FFFF
  191.  
  192.     EJECT
  193. *******************************************************************************
  194. *
  195. * Application specific global data
  196. *
  197. *******************************************************************************
  198.  
  199. ; This is a list of pointers to the text that is used to create our menus. It
  200. ; is used by InitApp to find all of the menu templates and use them to create
  201. ; our menubar. This loop loads MenuPtrLen-4 into an index, gets the
  202. ; corresponding menu template pointer in this table, and uses that in a
  203. ; NewMenu call. It then decrements the index by 4, and repeats the procees
  204. ; until the index is negative.
  205.  
  206. MenuPtr    dc.l AppMenu
  207.     dc.l FileMenu
  208.     dc.l EditMenu
  209. MenuPtrLen    equ *-MenuPtr
  210.  
  211.  
  212. ; Menu list: menu items should be numbered consecutivly starting from 250.
  213. ; As a convention, use 256 as about and 257 as Quit.
  214.  
  215. AppMenu    dc.b '$$@\XN1',$00
  216.     dc.b '--About Custom Control...\N256V',$00
  217.     dc.b '.'
  218. FileMenu    dc.b '$$  File  \N2',$00
  219.     dc.b '--Hide Sizer\N259',$00
  220.     dc.b '--Show Sizer\N258D',$00
  221.     dc.b '--Close\N255DV',$00
  222.     dc.b '--Quit\N257*Qq',$00
  223.     dc.b '.'
  224. EditMenu    dc.b '$$  Edit  \N3',$00
  225.     dc.b '--Undo\N250*ZzVD',$00
  226.     dc.b '--Cut\N251*XxD',$00
  227.     dc.b '--Copy\N252*CcD',$00
  228.     dc.b '--Paste\N253*VvD',$00
  229.     dc.b '--Clear\N254D',$00
  230.     dc.b '.'
  231.  
  232. theWindow    ds.b 4
  233.  
  234.  
  235. WindowTitle    str '  Custom Control  '
  236.  
  237. Stripes    dc.w $0000    ; Black frame
  238.     dc.w $0f00    ; Inact TBcolor, Inact TColor, Tcolor
  239.     dc.w $020f    ; Pattern, Pattern color, BG color
  240.     dc.w $0000    ; Frame growbox unselcted/selected
  241.     dc.w $00f0    ; infobar color (white)
  242.  
  243. WindData    dc.w WEnd-WindData
  244.     dc.w fTitle+fMove+fVis+fCtlTie
  245.     dc.l WindowTitle    ; Ptr to title
  246.     dc.l $0    ; RefCon
  247.     dc.w 0,0,0,0    ; Full Size (0= default)
  248.     dc.l Stripes    ; Color Table Pointer
  249.     dc.w 0,0    ; Vertical/Horizontal origin
  250.     dc.w 0,0    ; Data area height,    width
  251.     dc.w 0,0    ; Max Cont height, width
  252.     dc.w 0,0    ; Pixels to scroll vert'ly, horiz'ly
  253.     dc.w 0,0    ; Pixels to page vert'ly, horiz'ly
  254.     dc.l 0    ; Information bar refcon.
  255.     dc.w 0    ; Info bar height
  256.     dc.l 0    ; DefProc.
  257.     dc.l 0    ; Routine to draw info. bar.
  258.     dc.l doUpdate    ; Routine to draw content.
  259.     dc.w 30,40,160,400    ; Size and position
  260.     dc.l $FFFFFFFF    ; Plane to put window up in (topmost).
  261.     dc.l 0    ; Address of window record (0 to alloc)
  262. WEnd
  263.     ENDR
  264.  
  265.     EJECT
  266. *******************************************************************************
  267. *
  268. InitApp    PROC
  269. *
  270. * Description:    Perform any application specific initialization.
  271. *
  272. * Inputs:    NONE
  273. *
  274. * Outputs:    NONE
  275. *
  276. * External Refs:
  277.     import BoxProc
  278. *
  279. * Entry Points:    NONE
  280. *
  281. *******************************************************************************
  282.     With Globals
  283.  
  284.     stz QuitFlag
  285.  
  286.     pha
  287.     pha
  288.     PushLong #WindData
  289.     _NewWindow
  290.     PullLong theWindow    ; Pull off the window pointer
  291.  
  292. ; Create the two controls that we will be using in this demo. They are a
  293. ; custom control, and a simply button that will be resized and moved with
  294. ; the custom control. However, it is important that they be created in the
  295. ; right order. Since they will be lying right on top of each other, it is not
  296. ; apparent which one we want to select when we click on one of them. In cases
  297. ; like this, where a mouse click is on top of two controls, the Control
  298. ; Manager selects the one that was created first. So we create the custom
  299. ; control first.
  300.  
  301.     pha    ; space for result
  302.     pha
  303.     PushLong theWindow
  304.     PushLong #theRect
  305.     PushLong #0    ; no title
  306.     PushWord #%111    ; vis, int will drag, corners & edges
  307.     PushWord #$0503    ; Width = 5/Height = 3
  308.     PushLong #CtrlData    ; Pointer to additional data
  309.     PushLong #BoxProc    ; DefProc
  310.     PushLong #0    ; refcon
  311.     PushLong #0    ; std color table
  312.     _NewControl
  313.     PullLong Control1
  314.  
  315. ; It is possible that the rectangle that was used to create the above
  316. ; control is no longer the rectangle that is being used. This is because
  317. ; of the feature that aligns the corners of the control to the grid.
  318. ; In order to make the next control fall inside of the above control, get
  319. ; the CtlRect from its record, and use that when creating the simple
  320. ; button below.
  321.  
  322.     ldy #2    ; dereference the Control handle
  323.     lda [Control1],y    ; to get a pointer to the control
  324.     sta Ctl1Ptr+2    ; record into 'Ctl1Ptr'
  325.     lda [Control1]
  326.     sta Ctl1Ptr
  327.  
  328.     ldy #octlRect+6    ; now copy the control's rectangle
  329.     ldx #6    ; into 'theRect'
  330. loop0010    lda [Ctl1Ptr],y
  331.     sta theRect,x
  332.     dey
  333.     dey
  334.     dex
  335.     dex
  336.     bpl loop0010
  337.  
  338. ; now that that is done, we can create the simple button control
  339.  
  340.     pha    ; space for result
  341.     pha
  342.     PushLong theWindow
  343.     PushLong #theRect
  344.     PushLong #Title
  345.     PushWord #0
  346.     PushWord #0
  347.     PushLong #0
  348.     PushLong #simpleProc
  349.     PushLong #0    ; refcon
  350.     PushLong #0    ; std color table
  351.     _NewControl
  352.     PullLong Control2
  353.  
  354.     rts
  355.  
  356. theRect    dc.w 50,140,110,300
  357. Title    str 'Move/Resize Me'
  358. CtrlData    dc.w 10    ; min Y
  359.     dc.w 10    ; min X
  360.     dc.w 100    ; max Y
  361.     dc.w 200    ; max X
  362.     dc.w 16    ; grid Y
  363.     dc.w 32    ; grid X
  364.     ENDP
  365.  
  366.     EJECT
  367. *******************************************************************************
  368. *
  369. CloseApp    PROC
  370. *
  371. * Description:    Close down things. This disposes of all items and memory
  372. *    that we allocated.
  373. *
  374. *
  375. * Inputs:    NONE
  376. *
  377. * Outputs:    NONE
  378. *
  379. * External Refs:    NONE
  380. *
  381. * Entry Points:    NONE
  382. *
  383. *******************************************************************************
  384.     With Globals
  385.  
  386.     rts
  387.     ENDP
  388.  
  389.     EJECT
  390. *******************************************************************************
  391. *
  392. EventLoop    PROC
  393. *
  394. * Description:    Main Event Loop. Handle things until user selects Quit.
  395. *
  396. *
  397. * Inputs:    NONE
  398. *
  399. * Outputs:    NONE
  400. *
  401. * External Refs:
  402.     import MenuSelect
  403.     import Ignore
  404.     import doUpdate
  405.     import InContent
  406. *
  407. * Entry Points:    NONE
  408. *
  409. *******************************************************************************
  410.     With Globals
  411.  
  412. maxEvent    equ wInactMenu
  413.  
  414.     pha    ; Push on space for TaskMaster result
  415.     PushWord #everyEvent ; GetNextEvent mask
  416.     PushLong #EventRecord ; Pointer to Event Record
  417.     _TaskMaster
  418.  
  419.     pla    ; Get TaskMaster result
  420.     beq EventLoop    ; Remove if you want to use null events
  421.     cmp #maxEvent+1    ; is the event number in range?
  422.     bge EventLoop
  423.     asl A    ; Turn it into an index
  424.     tax
  425.     jsr (TaskTable,x)    ; Call appropriate event handler
  426.  
  427.     lda QuitFlag    ; Quit selected?
  428.     beq EventLoop    ; no - keep looping
  429.  
  430.     rts    ; yes- leave the program
  431.  
  432. TaskTable    dc.w Ignore    ; 0 Null
  433.     dc.w Ignore    ; 1 MouseDown
  434.     dc.w Ignore    ; 2 MouseUp
  435.     dc.w Ignore    ; 3 KeyDown
  436.     dc.w Ignore    ; 4 undefined
  437.     dc.w Ignore    ; 5 AutoKey
  438.     dc.w Ignore    ; 6 Update
  439.     dc.w Ignore    ; 7 undefined
  440.     dc.w Ignore    ; 8 Activate
  441.     dc.w Ignore    ; 9 Switch
  442.     dc.w Ignore    ; 10 Desk accessory
  443.     dc.w Ignore    ; 11 Device driver
  444.     dc.w Ignore    ; 12 ap
  445.     dc.w Ignore    ; 13 ap
  446.     dc.w Ignore    ; 14 ap
  447.     dc.w Ignore    ; 15 ap
  448.     dc.w Ignore    ; TASK 0 indesk
  449.     dc.w MenuSelect    ; TASK 1 in menuBar
  450.     dc.w Ignore    ; TASK 2 in system window
  451.     dc.w InContent    ; TASK 3 in content
  452.     dc.w Ignore    ; TASK 4 in Drag
  453.     dc.w Ignore    ; TASK 5 in grow
  454.     dc.w Ignore    ; TASK 6 in goaway
  455.     dc.w Ignore    ; TASK 7 in zoom
  456.     dc.w Ignore    ; TASK 8 in info bar
  457.     dc.w MenuSelect    ; TASK 9 in special    menu
  458.     dc.w Ignore    ; TASK 10 in NDA
  459.     dc.w Ignore    ; TASK 11 in frame
  460.     dc.w Ignore    ; TASK 12 in drop
  461.  
  462.     ENDP
  463.  
  464.     EJECT
  465. *******************************************************************************
  466. *
  467. MenuSelect    PROC
  468. *
  469. * Description:    This routine is called when TaskMaster returns a menu
  470. *    event. It takes the menu item that was hit and calculates
  471. *    an offset into the menu dispatch table. It then calls that
  472. *    routine and unhilites the menu when it is done.
  473. *
  474. * Inputs:    TaskData holds menu item selected.
  475. *
  476. * Outputs:    NONE
  477. *
  478. * External Refs:
  479.     import Ignore
  480.     import doAbout
  481.     import doQuit
  482.     import ShowSizer
  483.     import HideSizer
  484. *
  485. * Entry Points:    NONE
  486. *
  487. *******************************************************************************
  488.     With Globals
  489.  
  490.     lda TaskData    ; Get the ID of the menu item selected.
  491.     sec    ; Turn it into an index by subtracting
  492.     sbc #250    ; the starting ID number (25) and mul-
  493.     asl a    ; tiplying by 2 (each table entry con-
  494.     tax    ; sists of 2 bytes).
  495.     jsr (MenuTable,x)    ; Call the routine behind it.
  496.  
  497.     PushWord #0    ; Routine done - unhilite the menubar.
  498.     PushWord TaskData+2
  499.     _HiLiteMenu
  500.  
  501.     rts
  502.  
  503. MenuTable    dc.w Ignore    ; undo
  504.     dc.w Ignore    ; cut
  505.     dc.w Ignore    ; copy
  506.     dc.w Ignore    ; paste
  507.     dc.w Ignore    ; clear
  508.     dc.w Ignore    ; close
  509.     dc.w doAbout
  510.     dc.w doQuit
  511.     dc.w ShowSizer
  512.     dc.w HideSizer
  513.     ENDP
  514.  
  515.     EJECT
  516. *******************************************************************************
  517. *
  518. Ignore    PROC
  519. *
  520. * Description:    Called when I want to ignore an event.
  521. *
  522. *
  523. * Inputs:    NONE
  524. *
  525. * Outputs:    NONE
  526. *
  527. * External Refs:    NONE
  528. *
  529. * Entry Points:    NONE
  530. *
  531. *******************************************************************************
  532.  
  533.     rts
  534.     ENDP
  535.  
  536.     EJECT
  537. *******************************************************************************
  538. *
  539. doUpdate    PROC
  540. *
  541. * Description:    Called by TaskMaster to update a window's contents.
  542. *
  543. *
  544. * Inputs:    NONE
  545. *
  546. * Outputs:    NONE
  547. *
  548. * External Refs:    NONE
  549. *
  550. * Entry Points:    NONE
  551. *
  552. *******************************************************************************
  553.     with Globals
  554.     
  555.     pha
  556.     pha
  557.     _GetPort
  558.     _DrawControls
  559.  
  560.     rtl
  561.     ENDP
  562.  
  563.     EJECT
  564. *******************************************************************************
  565. *
  566. InContent    PROC
  567. *
  568. * Description:    Handle clicks within the content region of a window. In
  569. *    this demo, we want to see if we have clicked on either of
  570. *    the controls. We do this by calling FindControl. If
  571. *    FindControl tells us that we clicked on a control, then we
  572. *    want to track the actions of that control as we move the
  573. *    mouse. Calling TrackControl will do this until the use
  574. *    lift up on the mouse button. Finally, if the control we
  575. *    were tracking was the 'sizer' custom control, we want to
  576. *    resize/move the simple button that was associated with it.
  577. *    So we hide the button, change its bounding rectangle, and
  578. *    show it again in its new location.
  579. *
  580. *
  581. * Inputs:    NONE
  582. *
  583. * Outputs:    NONE
  584. *
  585. * External Refs:    NONE
  586. *
  587. * Entry Points:    NONE
  588. *
  589. *******************************************************************************
  590.     with Globals
  591.     
  592.     pha
  593.     PushLong #theControl
  594.     PushLong EventWhere
  595.     PushLong theWindow
  596.     _FindControl
  597.     pla    ; pull off the part code
  598.     bne TrackIt    ; hit a control
  599.     brl done
  600.  
  601. TrackIt    pha
  602.     PushLong EventWhere
  603.     PushLong #0    ; no action Proc
  604.     PushLong theControl
  605.     _TrackControl
  606.     pla
  607.  
  608.     cmp #$A0    ; did we track the Sizer?
  609.     bne done    ; no, so don't move anything
  610.  
  611.     PushLong Control2    ; hide the simple button
  612.     _HideControl
  613.  
  614.     PushLong Control1    ; hide the Sizer
  615.     _HideControl
  616.  
  617.     ldy #2    ; Get Control's pointer and put it
  618.     lda [Control1],y    ; into a Direct Page location
  619.     sta Ctl1Ptr+2
  620.     lda [Control1]
  621.     sta Ctl1Ptr    ; 'Ctl1Ptr' points to the Sizer.
  622.  
  623.     ldy #2    ; Do the exact same thing with the
  624.     lda [Control2],y    ; simple button.
  625.     sta Ctl2Ptr+2    
  626.     lda [Control2]
  627.     sta Ctl2Ptr    ; 'Ctl2Ptr' points to the simple button
  628.  
  629.     ldy #octlRect    ; Now copy the bounding rectangle of
  630. loop    lda [Ctl1Ptr],y    ; the Sizer into the bounding rectangle
  631.     sta [Ctl2Ptr],y    ; of the button. When we next show the
  632.     iny    ; button, it will have the same size
  633.     iny    ; and location as the Sizer.
  634.     cpy #octlRect+8
  635.     bne loop
  636.  
  637.     PushLong Control2    ; Now Show Them both
  638.     _ShowControl
  639.  
  640.     PushLong Control1
  641.     _ShowControl
  642.  
  643. done
  644.     rts
  645.  
  646. theControl    ds.b 4
  647.  
  648.     ENDP
  649.  
  650.     EJECT
  651. *******************************************************************************
  652. *
  653. ShowSizer    PROC
  654. *
  655. * Description:    Call _ShowControl to...well...uh, show the control. Disable
  656. *    the "Show Sizer" menu item and enable the "Hide Sizer" menu
  657. *    item.
  658. *
  659. *
  660. * Inputs:    NONE
  661. *
  662. * Outputs:    NONE
  663. *
  664. * External Refs:    NONE
  665. *
  666. * Entry Points:    NONE
  667. *
  668. *******************************************************************************
  669.     With Globals
  670.  
  671.     PushLong Control1
  672.     _ShowControl
  673.  
  674.     PushWord #258    ; Disable the Show menu item
  675.     _DisableMItem
  676.  
  677.     PushWord #259    ; Enable the Hide Menu item
  678.     _EnableMItem
  679.  
  680.     rts
  681.     ENDP
  682.  
  683.  
  684.     EJECT
  685. *******************************************************************************
  686. *
  687. HideSizer    PROC
  688. *
  689. * Description:    Call _HideControl to hide the control. Enable the "Show
  690. *    Sizer" menu item and disable the "Hide Sizer" menu item.
  691. *
  692. *
  693. * Inputs:    NONE
  694. *
  695. * Outputs:    NONE
  696. *
  697. * External Refs:    NONE
  698. *
  699. * Entry Points:    NONE
  700. *
  701. *******************************************************************************
  702.     With Globals
  703.  
  704.     PushLong Control1
  705.     _HideControl
  706.  
  707.     PushWord #258    ; Enable the Show menu item
  708.     _EnableMItem
  709.  
  710.     PushWord #259    ; Disable the Hide Menu item
  711.     _DisableMItem
  712.  
  713.     rts
  714.     ENDP
  715.  
  716.     include 'BoxCtrl.Stds.aii'
  717.     include 'BoxCtrl.DefProc.aii'
  718.  
  719.     END
  720.  
  721.